package com.wywah.yunduo;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.nio.file.Paths;

public class GeneratorMain {

    public static void main(String[] args) {






        FastAutoGenerator.create("jdbc:mysql://127.0.0.1:3306/yunduo", "root", "wyw1234567890")
                .globalConfig(builder -> builder
                        .author("wywah")
//                        .outputDir(Paths.get(System.getProperty("user.dir")) + "/src/main/java")
                        .outputDir("D://generator-worksapce/oauth")
                        .commentDate("yyyy-MM-dd")
                )
                .packageConfig(builder -> builder
                        .parent("com.wywah.yunduo.oauth")
                        .entity("bean")
                        .mapper("dao")
                        .service("service")
                        .serviceImpl("service.impl")
                        .xml("mapper.xml")
                )
                .strategyConfig(builder -> builder
                        .addInclude("sys_client")
                        .addTablePrefix("sys_")
                        .entityBuilder()
                        .enableFileOverride()


//                        .enableLombok()
                )
                .templateEngine(new FreemarkerTemplateEngine())
                .execute();
    }
}
